package cn.edu.cuc.yjsy.admin.internal;

import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;

import cn.edu.cuc.yjsy.admin.views.DetailView;
import cn.edu.cuc.yjsy.admin.views.QueryResultView;
import cn.edu.cuc.yjsy.admin.views.QueryView;
import cn.edu.cuc.yjsy.admin.views.ReportNavigatorView;

public class Perspective implements IPerspectiveFactory {

	public void createInitialLayout(IPageLayout layout) {
		String editorArea = layout.getEditorArea();
		layout.setEditorAreaVisible(false);
		
		layout.addStandaloneView(ReportNavigatorView.ID,  false, IPageLayout.LEFT, (float)0.22, editorArea);
		layout.addStandaloneView(QueryView.ID, false, IPageLayout.BOTTOM, (float)0.6, ReportNavigatorView.ID);
		IFolderLayout topfolder = layout.createFolder("top", IPageLayout.TOP, (float)0.7, editorArea);
		topfolder.addPlaceholder(DetailView.ID + ":*");
		IFolderLayout resultfolder= layout.createFolder("bottom", IPageLayout.BOTTOM, (float)0.7, editorArea); //$NON-NLS-1$
		resultfolder.addPlaceholder(QueryResultView.ID + ":*");

//		layout.addView(QueryView.ID, IPageLayout.RIGHT, (float)1, editorArea);
		
		layout.getViewLayout(ReportNavigatorView.ID).setCloseable(false);
		layout.getViewLayout(QueryView.ID).setCloseable(false);
	}
}
